/**
 * Created by CK on 2017/7/25.
 */
$(function(){
    var remarkDom = $('#remark'),
        taskId    = xhTool.getQuery('taskId');
    if(remarkDom){
        $(window.top.document, '#bt_modal_confirm').click(function(){
            var remark = remarkDom.val();
            if(remark){
                $.ajax({
                    url: baseUrl + 'Track/setTaskRemark',
                    data: {taskId: taskId, remark: remark},
                    type: 'POST',
                    dataType: 'json',
                    complete: function(XMLHttpRequest)
                    {
                        var result = XMLHttpRequest.responseJSON || XMLHttpRequest.responseText;
                        if(xhExtra.checkError(result)) return false;
                        window.top.xhTop.showMessage({
                            type: 'success',
                            title: '修改成功！'
                        });
                        window.top.xhTop.getActiveFrame().list.dataGridReload();
                    }
                });
            }
            $(this).unbind('click');
            window.top.xhTop.closeModal();
        });
    }
});